<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>vue生命周期函数</title>
    <script src="https://unpkg.com/vue@next"></script>
    <!-- 
        1.事件修饰符:stop,prevent,capture,self,once
        2.按键修饰符:
            .enter:按enter才会触发函数
            .tab
            .delete
            .esc
            .up
            .down
            鼠标修饰符
            .left
            .right
        3.精准修饰符:exact 精确到一个按键
     -->
</head>
<body>
    <div id="root"></div>
    <script>
        // vue的生命周期函数
        const app = Vue.createApp({
            data() {
                return {
                    
                }
            },
            methods: {
                btnkeyDown(event) {
                    console.log("keydown");
                },
                btnkeydel(event){
                    console.log("delete");
                },
                btnCtrl(){
                    console.log("ctrl");
                }
            },
            template:`
                <div>

                    <input @keydown.delete="btnkeydel" /><br>
                    <input @keydown.enter="btnkeyDown" />
                    <input @click.ctrl.exact="btnCtrl" type="button" value="CTR" /><br>
                </div>
            `
        });
        const vm = app.mount('#root');
    </script>
</body>
</html>